package com.zzzzzz.config;

import javax.inject.Inject;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import com.zzzzzz.core.data.filestore.FileStorage;
import com.zzzzzz.core.data.filestore.OSSFileStorage;

@Configuration
public class FileStoreConfig {
	
	@Inject
	private Environment environment;

	@Bean
	public FileStorage pictureStorage() {
		return new OSSFileStorage(environment.getProperty("oss.access_id"), environment.getProperty("oss.access_key"), environment.getProperty("oss.endpoint"), environment.getProperty("oss.bucket"));
	}
	
}
